package com.app.base.service.common.controller;


import com.alibaba.fastjson.JSONObject;
import com.app.base.service.common.service.CommonService;
import com.app.base.utlis.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(tags = "基本组件")
@RequestMapping("commonController")
public class CommonController {

    @Resource
    private CommonService commonService;

    @PostMapping("verificationCode")
    @ApiOperation("发送验证码")
    public Result verificationCode(@RequestBody JSONObject json){
        String phone = json.getString("phone");
        return commonService.verificationCode(phone);
    }

}
